<template>
  <view class="steps">
    <view class="step">
      <view class="step-line" :class="{'active-line': active >= 2}"></view>
      <view class="step-content">
        <image :src="$store.state.imgBaseUrl + '/qrcode/step1.png'" mode="" class="step-img"></image>
        <view class="step-text" :class="{'active-color': active >= 1}">
          商户信息
        </view>
      </view>
    </view>
    <view class="step">
      <view class="step-line" :class="{'active-line': active >= 3}"></view>
      <view class="step-content">
        <image :src="active >= 2 ? $store.state.imgBaseUrl + '/qrcode/bank-step-2-active.png' : $store.state.imgBaseUrl + '/qrcode/bank-step-2.png'" mode="" class="step-img"></image>
        <view class="step-text" :class="{'active-color': active >= 2}">
          营业执照
        </view>
      </view>
    </view>
    <view class="step">
      <view class="step-line" :class="{'active-line': active >= 4}"></view>
      <view class="step-content">
        <image :src="active >= 3 ? $store.state.imgBaseUrl + '/qrcode/step3_active.png' : $store.state.imgBaseUrl + '/qrcode/step3.png'" mode="" class="step-img"></image>
        <view class="step-text" :class="{'active-color': active >= 3}">
          法人身份
        </view>
      </view>
    </view>
    <view class="step step-end">
      <view class="step-line" :class="{'active-line': active >= 4}"></view>
      <view class="step-content">
        <image :src="active >= 4 ? $store.state.imgBaseUrl + '/qrcode/step3_active.png' : $store.state.imgBaseUrl + '/qrcode/step3.png'" mode="" class="step-img"></image>
        <view class="step-text" :class="{'active-color': active >= 4}">
          结算信息
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: 'steps',
  props: {
    active: {
      // 当前步骤
      type: Number,
      default: 1
    },
  },
  data () {
    return {}
  }
}
</script>

<style lang="scss" scoped>
  .steps {
    display: flex;
    padding: 0 54rpx;
    height: 202rpx;
    background: #FFFFFF;
    &:after {
      content: '';
      display: block;
      clear: both;
    }
    .step {
      float: left;
      // flex: 1;
      position: relative;
      width: 180rpx;
      &:after {
        content: '';
        display: block;
        clear: both;
      }
      .step-line {
        height: 2rpx;
        width: 66rpx;
        margin-left: 114rpx;
        background-color: #e0e0e0;
        box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
        margin-top: 84rpx;
      }
      
      .active-line {
        background-color: #C2AC78;
      }
      
      .step-content {
        position: absolute;
        top:42rpx;
        display: flex;
        align-content: center;
        flex-flow: column;
        align-items: center;
        .step-img {
          display: inline-block;
          height: 80rpx;
          width: 80rpx;
          // color: #fff;
          // background-color: #b9b9b9;
          border-radius: 50%;
          text-align: center;
          // border:2px solid rgba(224,224,224,1);
        }
        .step-text {
          margin-top: 21rpx;
          font-size: 26rpx;
          color: #999999;
        }
        
        .active-color {
          color: #C2AC78;
        }
      }
    }
    
    .step-end {
      width: 102rpx;
      flex: inherit;
      position: unset;
      .step-line{
         display: none;
      }
    }
  }
</style>
